//----------------------------------------------------------------------------
//  (c) 2006    Guillermo Jimenez Diaz
//----------------------------------------------------------------------------
#include "nstringqueue/nstringqueue.h"

static void n_add(void* slf, nCmd* cmd);
static void n_getfront(void* slf, nCmd* cmd);
//----------------------------------------------------------------------------
/**
    @scriptclass
    nstringqueue

    @cppclass
    nStringQueue
    
    @superclass
    nroot

    @classinfo
    A scriptable queue of strings
*/
void
n_initcmds(nClass* clazz)
{
    clazz->BeginCmds();
    clazz->AddCmd("v_add_s", 'ADDS', n_add);
    clazz->AddCmd("s_getfront_v", 'GETF', n_getfront);
    // etc.
    clazz->EndCmds();
}

static void
n_add(void* slf, nCmd* cmd)
{
	nStringQueue* self = (nStringQueue*) slf;
	self->add(cmd->In()->GetS());
}
static void

n_getfront(void* slf, nCmd* cmd)
{
	nStringQueue* self = (nStringQueue*) slf;
	cmd->Out()->SetS((self->getFront()).c_str());
}
//----------------------------------------------------------------------------
// EOF
//----------------------------------------------------------------------------
